#ifndef HAND_H
#define HAND_H
#define HANDVALUE_ROC 0 // rock
#define HANDVALUE_SCI 1 // scissors
#define HANDVALUE_BAG 2 // bag

class Hand
{
private:
    char *handName[3] = {"ROCK", "SCISSORS", "BAG"};
    unsigned int handvalue;

    // deside who wins: this & h
    // 0 = equal; 1 = this win; -1 = this loss;
    int fight(Hand *h);

public:
    // save impls of different hand signs
    static Hand *hands[3];

    // get hand sign for next round, delegate job to strategy.
    static Hand *getHand(unsigned int val);

    Hand(unsigned int val): handvalue(val)
    {
    }

    // judge who wins
    bool isStringerThan(Hand *h);
    bool isWeakerThan(Hand *h);

    // print name of current hans sign
    char *toString();
};

#endif // !HAND_H
